//
//  YMRoomManager.h
//  YMRTC
//
//  Created by admin on 2022/4/19.
//

#import <Foundation/Foundation.h>
#import "YMRoomInfo.h"
#import "YMCommonDefs.h"
#import "YMConversation.h"

NS_ASSUME_NONNULL_BEGIN

/**
 * IM 聊天室管理器。 管理聊天室的创建
 */
@interface YMRoomManager : NSObject

/**
 * 创建聊天室
 *
 * @param name 聊天室名称
 *
 * @param portrait 聊天室头像
 *
 * @param uidsList 加入聊天室的用户列表
 *
 */
- (void)createRoomWithName:(NSString *)name
                   portrait:(NSString *)portrait
                       uids:(NSArray<NSString *> *)uidsList
                 completion:(void(^)(YMRoomInfo *roomInfo, YMErrorCode code))completionBlock;


/**
 * 获取聊天室列表
 *
 * @param count 显示数据 0表示不限
 *
 * @param label 分组标签：区分一组群组列表
 */
- (void)getRoomListWithCount:(NSInteger)count
                        label:(NSInteger)label
              completionBlock:(void(^)(NSArray<YMConversation *> *dataSource, YMErrorCode code))completionBlock;
/**
 * 解散聊天室
 *
 * @param roomId 聊天室id
 */
- (void)dismissRoomWithRoomId:(NSString *)roomId
                     completion:(void(^)(YMErrorCode code))completionBlock;


/**
 * 邀请用户进入聊天室
 *
 * @param roomId 聊天室Id
 *
 * @param uidsList 用户唯一标识Id 数组
 */
- (void)inviteIntoRoomWithRoomId:(NSString *)roomId
                              uids:(NSArray<NSString *> *)uidsList
                        completion:(void(^)(YMErrorCode code))completionBlock;


/**
 * 请离聊天室
 *
 * @param roomId 聊天室Id
 *
 * @param uidsList 用户唯一身份数组
 */
- (void)kickRoomWithRoomId:(NSString *)roomId
                        uids:(NSArray<NSString *> *)uidsList
                  completion:(void(^)(YMErrorCode code))completionBlock;


/**
 * 用户离开聊天室
 *
 * @param roomId 聊天室Id
 */
- (void)leaveRoomWithRoomId:(NSString *)roomId
                   completion:(void(^)(YMErrorCode code))completionBlock;

/**
 * 用户加入聊天室
 *
 * @param roomId 聊天室Id
 */
- (void)joinRoomWithRoomId:(NSString *)roomId
                   completion:(void(^)(YMErrorCode code))completionBlock;

/**
 *用户禁言
 *
 * @param roomId 聊天室Id
 */
- (void)muteRoomWithRoomId:(NSString *)roomId
                       uid:(NSString *)uid
                   completion:(void(^)(YMErrorCode code))completionBlock;

/**
 *用户解除禁言
 *
 * @param roomId 聊天室Id
 */
- (void)unmuteRoomWithRoomId:(NSString *)roomId
                       uid:(NSString *)uid
                   completion:(void(^)(YMErrorCode code))completionBlock;

/**
 * 修改聊天室名称
 *
 * @param roomId 聊天室Id
 *
 * @param roomName 聊天室名称
 */
- (void)updaterRoomNameWithRoomId:(NSString *)roomId
                         roomName:(NSString *)roomName
                        completion:(void(^)(YMErrorCode code))completionBlock;

/**
 * 搜索聊天室/群组
 *
 * @param count 显示数据 0表示不限
 *
 * @param label 分组标签：区分一组群组列表
 */
- (void)searchRoomListWithCount:(NSInteger)count
                        label:(NSInteger)label
                        roomName:(NSString *)roomName
                        completionBlock:(void(^)(NSArray<YMConversation *> *dataSource, YMErrorCode code))completionBlock;

@end

NS_ASSUME_NONNULL_END
